$(function(){

	//抢单
	$(document).on( "click", ".js_to_take", function(e) { 
		var url = $(this).attr("data-href");
		var user_id = $(this).attr("data-id");
		var _token = $("input[name='_token']").val();
		
	    $.post(url,{"user_id":user_id,"_token":_token},function(data){
	        
	      },'json').error(function(data) {
	          var obj = $.parseJSON(data.responseText);
	          $.each(obj.error_messages, function(i, item){
	            console.info(item[0]);
	          });
	      }).success(function(data) {
	          layer.msg(data.data);
	          window.location.href=jumpreplied;
	      });
	      stopDefault(e);
	})


});
